<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui">
<h:head>
	<title>Cadastro RDV</title>
	<link rel="stylesheet" type="text/css" href="css/tabela.css" />
</h:head>
<ui:composition template="/Menu.xhtml">
	<ui:define name="corpo">
		<h:body>
			<f:view encoding="ISO-8859-1">
				<h:form id="novaVisita">
					<h:messages layout="table" errorStyle="color: red"
						infoStyle="color: green" warnStyle="color: orange"
						fatalStyle="color: gray" showDetail="true" />
					<h4>Alterar Limite</h4>
					<h:panelGrid columns="2">
						<h:outputLabel value="RDV" />
						<h:selectOneMenu value="#{cadastroDespesaLimite.rdv.id}">
							<f:selectItems value="#{cadastroDespesaLimite.listaRdv}" var="t"
								itemLabel="#{t.tipo}" itemValue="#{t.id}" />
						</h:selectOneMenu>
					</h:panelGrid>
					<br />
					<h:commandButton styleClass="g-button g-button-submit"
						action="#{cadastroDespesaLimite.consultar}" value="CONSULTAR"
						style="width:150px" />
					<br />
					<br />
					<p:dataTable id="tabelaLimite" var="limite"
						value="#{cadastroDespesaLimite.lista}" editable="true">

						<p:column headerText="Usuario" width="100px">
							<h:outputLabel value="#{limite.login}" />
						</p:column>
						<p:column headerText="Nome" width="100px">
							<h:outputLabel value="#{limite.nome}" />
						</p:column>
						<p:column headerText="Limite Original" width="100px">
							<h:outputLabel value="#{limite.limiteOriginal}">
								<f:convertNumber pattern="0.00" maxFractionDigits="2" />
							</h:outputLabel>
						</p:column>

						<p:column headerText="Limite Atual">
							<p:cellEditor>
								<f:facet name="output">
									<h:outputText value="#{limite.limiteAtual}">
										<f:convertNumber pattern="0.00" maxFractionDigits="2" />
									</h:outputText>
								</f:facet>
								<f:facet name="input">
									<p:inputText value="#{limite.limiteAtual}" style="width:100%">
										<f:convertNumber pattern="0.00" maxFractionDigits="2" />
									</p:inputText>
								</f:facet>
							</p:cellEditor>
						</p:column>
						<p:column style="width:32px">
							<p:rowEditor />
						</p:column>
						<p:ajax event="rowEdit"
							listener="#{cadastroDespesaLimite.onRowEdit}" />
						<p:ajax event="rowEditCancel"
							listener="#{cadastroDespesaLimite.onRowCancel}" />
					</p:dataTable>
				</h:form>
			</f:view>
		</h:body>
	</ui:define>
</ui:composition>
</html>